<!doctype html>



  


<html class="theme-next mist use-motion" lang="en">
<head>
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="database," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="This contains functional dependencies and normal form.">
<meta property="og:type" content="article">
<meta property="og:title" content="Database System Review 02">
<meta property="og:url" content="https://annashuo.github.io/2017/09/14/database-system-review02/index.html">
<meta property="og:site_name" content="Anna's Blog">
<meta property="og:description" content="This contains functional dependencies and normal form.">
<meta property="og:updated_time" content="2017-09-20T16:43:38.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Database System Review 02">
<meta name="twitter:description" content="This contains functional dependencies and normal form.">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"right","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://annashuo.github.io/2017/09/14/database-system-review02/"/>





  <title> Database System Review 02 | Anna's Blog </title><!-- hexo-inject:begin --><!-- hexo-inject:end -->
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="en">

  
<!-- hexo-inject:begin --><!-- hexo-inject:end --><script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '',
      xfbml      : true,
      version    : 'v2.6'
    });
  };

  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "//connect.facebook.net/en/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>



<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-105321506-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?6f5ab2ef1e021070500f7228c830f3c6";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-right page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Anna's Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
    
      <p class="site-subtitle">My heart is in the work...</p>
    
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="https://annashuo.github.io/2017/09/14/database-system-review02/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="Anna">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="Anna's Blog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="Anna's Blog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Database System Review 02
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-09-14T18:00:22-04:00">
                2017-09-14
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">In</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/STUDY/" itemprop="url" rel="index">
                    <span itemprop="name">STUDY</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2017/09/14/database-system-review02/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count fb-comments-count" data-href="https://annashuo.github.io/2017/09/14/database-system-review02/" itemprop="commentCount">0</span> comments
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>This contains functional dependencies and normal form.</p>
<a id="more"></a>
<h3 id="Functional-Dependencies-FD"><a href="#Functional-Dependencies-FD" class="headerlink" title="Functional Dependencies (FD)"></a>Functional Dependencies (FD)</h3><h4 id="Definition"><a href="#Definition" class="headerlink" title="Definition"></a>Definition</h4><p>A Functional Dependency (FD) is a form of a constraint, part of a relation’s schema to define a valid instance.</p>
<script type="math/tex; mode=display">X \rightarrow Y</script><p>The value of X functionally defines the value of Y. For example, if two tuples$(t<em>{1},t</em>{2})$ agree on the X attribute, then they must agree on the Y attribute too.</p>
<script type="math/tex; mode=display">(X \rightarrow Y) \, + \, (X \rightarrow Z) \, \Rightarrow \, (X \rightarrow YZ)</script><script type="math/tex; mode=display">(XY \rightarrow Z) \, \not\Rightarrow \, (X \rightarrow Z) \, + \, (Y \rightarrow Z)</script><h4 id="Definning-FDs-in-SQL"><a href="#Definning-FDs-in-SQL" class="headerlink" title="Definning FDs in SQL"></a>Definning FDs in SQL</h4><p>eg.</p>
<script type="math/tex; mode=display">FD_{1}: sid \rightarrow name</script><script type="math/tex; mode=display">FD_{2}: sid \rightarrow address</script><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">CREATE ASSERTION student-name-addr </div><div class="line">  CHECK (NOT EXISTS</div><div class="line">    (SELECT * FROM students AS s1, </div><div class="line">                   students AS s2</div><div class="line">      WHERE s1.sid = s2.sid</div><div class="line">        AND((s1.name &lt;&gt; s2.name</div><div class="line">        	OR (s1.address &lt;&gt; s2.address)));</div></pre></td></tr></table></figure>
<h4 id="Armstrong’s-Axioms"><a href="#Armstrong’s-Axioms" class="headerlink" title="Armstrong’s Axioms"></a>Armstrong’s Axioms</h4><ul>
<li>Reflexivity: $X \supseteq Y \Rightarrow X \rightarrow Y$</li>
<li>Augmentation: $X \rightarrow Y \Rightarrow XZ \rightarrow YZ$</li>
<li>Transitivity: $(X \rightarrow Y) \wedge (Y \rightarrow Z) \Rightarrow (X \rightarrow Z)$</li>
<li>Union: $(X \rightarrow Y) \wedge (X \rightarrow Z) \Rightarrow (X \rightarrow YZ)$</li>
<li>Decomposition: $(X \rightarrow YZ) \Rightarrow (X \rightarrow Y) \wedge (X \rightarrow Z)  $</li>
<li>Pseudo-transitivity: $(X \rightarrow Y) \wedge (YW \rightarrow Z) \Rightarrow (XW \rightarrow YZ)$</li>
</ul>
<h4 id="Closure-F"><a href="#Closure-F" class="headerlink" title="Closure (F+)"></a>Closure (F+)</h4><p>Given a set F of FDs, closure F+ is the set of all implied FDs.</p>
<p>To check $X \rightarrow A$:</p>
<ol>
<li>compute X+</li>
<li>check if $A \in X+$</li>
</ol>
<h4 id="Canonical-Cover-F-c"><a href="#Canonical-Cover-F-c" class="headerlink" title="Canonical Cover ($F_{c}$)"></a>Canonical Cover ($F_{c}$)</h4><p>Given a set F of FDs, canonical cover $F_{c}$ is the minimal set of all FDs.</p>
<p>$F_{c}$ properties:</p>
<ol>
<li>The right-hand side(RHS) of every FD is a single attribute</li>
<li>$F_{c}$ is identical to the closure F+</li>
<li>$F_{c}$ is minimal(we cannot eliminate any attribute from the LHS or RHS of a FD)</li>
<li>$F_{c}$ LHS usually unique</li>
</ol>
<h3 id="Relational-Model-Keys"><a href="#Relational-Model-Keys" class="headerlink" title="Relational Model Keys"></a>Relational Model Keys</h3><ul>
<li>Super key: any set of attributes in a relation that functionally determines all attributes in the relation (随意组合attribute，只要组合出来的结果可以决定其他所有attribute，这个组合就是super key)</li>
<li>Candidate key: any super key such that the removal of any attribute leaves a set that does not functionally determine all attributes (super key里面元素最少的一个是candidate key)</li>
<li>primary key = candidate key</li>
</ul>
<h3 id="Decomposition-Goals"><a href="#Decomposition-Goals" class="headerlink" title="Decomposition Goals"></a>Decomposition Goals</h3><ul>
<li>Lossless Joins (<strong>mandatory</strong>): 要保证lossless joins，找出最有决定性的LHS的attribute，以它作为跨越多个表的attribute进行拆分</li>
<li>Dependency Preservation: 最好同一个FD里的attribute在拆分后的同一个表内</li>
<li>Redundancy Avoidance</li>
</ul>
<h4 id="Lossless-Joins"><a href="#Lossless-Joins" class="headerlink" title="Lossless Joins"></a>Lossless Joins</h4><p>For the decomposition $R={R<em>{1}\cup R</em>{n}}$, check whether $(R<em>{1} \cap R</em>{2})\rightarrow R<em>{1}$ <strong>or</strong> $(R</em>{1} \cap R<em>{2})\rightarrow R</em>{2}$</p>
<h4 id="Dependency-Preservation"><a href="#Dependency-Preservation" class="headerlink" title="Dependency Preservation"></a>Dependency Preservation</h4><p>To test whether the decomposition $R={R<em>{1},..R</em>{n}}$ preserves the FD set F:</p>
<ol>
<li>Compute F+</li>
<li>Divide F+ into sets of only covered by ${R<em>{1},..,R</em>{n}}$</li>
<li>Compute G as union of those sets</li>
<li>Compute G+</li>
<li>If F+=G+, then ${R<em>{1},..,R</em>{n}}$ is dependency preserving</li>
</ol>
<h4 id="Redundancy-Avoidance"><a href="#Redundancy-Avoidance" class="headerlink" title="Redundancy Avoidance"></a>Redundancy Avoidance</h4><p>For an $X \rightarrow Y$ covered by$R<em>{n}$, X should be a super key of $R</em>{n}$</p>
<h3 id="Normal-Forms"><a href="#Normal-Forms" class="headerlink" title="Normal Forms"></a>Normal Forms</h3><p>A Normal Form is a characterization of a decomposition in terms of the properties that satisfies when putting the relations back together.</p>
<h4 id="First-Normal-Form-1NF"><a href="#First-Normal-Form-1NF" class="headerlink" title="First Normal Form(1NF)"></a>First Normal Form(1NF)</h4><ol>
<li>All value must be atomic</li>
<li>No repeating groups</li>
</ol>
<h4 id="Second-Normal-Form-2NF"><a href="#Second-Normal-Form-2NF" class="headerlink" title="Second Normal Form(2NF)"></a>Second Normal Form(2NF)</h4><ol>
<li>1NF</li>
<li>Non-key attributes fully depend on the candidate key</li>
</ol>
<p>Decomposition后，如果一个表里除了一个FD的LHS和RHS以外还有其他的attribute，就提出LHS和RHS成立一个新的表</p>
<h4 id="Boyce-codd-Normal-Form-BCNF"><a href="#Boyce-codd-Normal-Form-BCNF" class="headerlink" title="Boyce-codd Normal Form(BCNF)"></a>Boyce-codd Normal Form(BCNF)</h4><ul>
<li>+no lossless joins</li>
<li>+no redundancies</li>
<li>-dependency perserving</li>
</ul>
<p><strong>for every FD in a relation R, LHS must be super key</strong></p>
<p>A relation R with FD set F is in BCNF if for every $X \rightarrow Y$ in F+:</p>
<ul>
<li>$X \rightarrow Y$ is trivial (that is, $Y \subseteq X$), or</li>
<li>X is a super key</li>
</ul>
<h5 id="BCNF-decomposition-algorithem-Given-a-relation-R-and-a-FD-set-F"><a href="#BCNF-decomposition-algorithem-Given-a-relation-R-and-a-FD-set-F" class="headerlink" title="BCNF decomposition algorithem(Given a relation R and a FD set F):"></a>BCNF decomposition algorithem(Given a relation R and a FD set F):</h5><ul>
<li>Compute F+</li>
<li>$Result \leftarrow {R}$</li>
<li>While $R_{i} \in Result$ not in BCNF, do:<ul>
<li>Choose$(X \rightarrow Y)\in F+$ such that $(X \rightarrow Y)$ is covered by $R<em>{i}$ and $X \not\rightarrow R</em>{i}$ </li>
<li>Decompose $R<em>{i}$ on $(X \rightarrow Y)$ into $R</em>{i,1} \leftarrow X \cup Y$ and $R<em>{i,2} \leftarrow R</em>{i}-Y$</li>
</ul>
</li>
</ul>
<h5 id="Problem-with-BCNF"><a href="#Problem-with-BCNF" class="headerlink" title="Problem with BCNF"></a>Problem with BCNF</h5><p>After decomposed R into BCNF relations ${R<em>{1},…,R</em>{n}}$ with their own ${FD<em>{1},….FD</em>{n}}$, we can reconstruct R from ${R<em>{1},…,R</em>{n}}$ but cannot reconstruct FD from ${FD<em>{1},….FD</em>{n}}$.</p>
<h4 id="Third-Normal-Form-3NF"><a href="#Third-Normal-Form-3NF" class="headerlink" title="Third Normal Form(3NF)"></a>Third Normal Form(3NF)</h4><ul>
<li>+no lossless joins</li>
<li>no redundancies</li>
<li>dependency perserving</li>
</ul>
<p>A relation R with FD set F is in 3NF if for every $X \rightarrow Y$ in F+:</p>
<ul>
<li>$X \rightarrow Y$ is trivial, or</li>
<li>X is a super key, or</li>
<li>Y is part of a candidate key</li>
</ul>
<h5 id="3NF-decomposition-algorithem-Given-a-relation-R-and-a-FD-set-F"><a href="#3NF-decomposition-algorithem-Given-a-relation-R-and-a-FD-set-F" class="headerlink" title="3NF decomposition algorithem(Given a relation R and a FD set F):"></a>3NF decomposition algorithem(Given a relation R and a FD set F):</h5><ul>
<li>Compute $F_{c}$</li>
<li>$Result \leftarrow \phi$</li>
<li>For $(X \rightarrow Y)\in F<em>{c}$, add a relation $R</em>{i}(X,Y)$ to Result</li>
<li>If result is not lossless, add a relation with an appropriate key</li>
</ul>
<h5 id="3NF-and-BCNF"><a href="#3NF-and-BCNF" class="headerlink" title="3NF and BCNF"></a>3NF and BCNF</h5><ul>
<li>both lossless</li>
<li>BCNF lose dependency preservation</li>
<li>3NF lose redanduncy avoidance</li>
</ul>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/database/" rel="tag"># database</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/14/database-system-review01/" rel="next" title="Database System Review 01">
                <i class="fa fa-chevron-left"></i> Database System Review 01
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/19/web-knowledge/" rel="prev" title="web_knowledge">
                web_knowledge <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>

          
          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="fb-comments"
           data-href="https://annashuo.github.io/2017/09/14/database-system-review02/"
           data-numposts="10"
           data-width="100%"
           data-colorscheme="light">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="Anna" />
          <p class="site-author-name" itemprop="name">Anna</p>
          <p class="site-description motion-element" itemprop="description">My heart is in the work...</p>
        </div>
        <nav class="site-state motion-element">
        
          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">43</span>
                <span class="site-state-item-name">posts</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">6</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">12</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/Annashuo/Annashuo.github.io" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/u/1861044584?is_all=1" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Functional-Dependencies-FD"><span class="nav-number">1.</span> <span class="nav-text">Functional Dependencies (FD)</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Definition"><span class="nav-number">1.1.</span> <span class="nav-text">Definition</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Definning-FDs-in-SQL"><span class="nav-number">1.2.</span> <span class="nav-text">Definning FDs in SQL</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Armstrong’s-Axioms"><span class="nav-number">1.3.</span> <span class="nav-text">Armstrong’s Axioms</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Closure-F"><span class="nav-number">1.4.</span> <span class="nav-text">Closure (F+)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Canonical-Cover-F-c"><span class="nav-number">1.5.</span> <span class="nav-text">Canonical Cover ($F_{c}$)</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Relational-Model-Keys"><span class="nav-number">2.</span> <span class="nav-text">Relational Model Keys</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Decomposition-Goals"><span class="nav-number">3.</span> <span class="nav-text">Decomposition Goals</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Lossless-Joins"><span class="nav-number">3.1.</span> <span class="nav-text">Lossless Joins</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Dependency-Preservation"><span class="nav-number">3.2.</span> <span class="nav-text">Dependency Preservation</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Redundancy-Avoidance"><span class="nav-number">3.3.</span> <span class="nav-text">Redundancy Avoidance</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Normal-Forms"><span class="nav-number">4.</span> <span class="nav-text">Normal Forms</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#First-Normal-Form-1NF"><span class="nav-number">4.1.</span> <span class="nav-text">First Normal Form(1NF)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Second-Normal-Form-2NF"><span class="nav-number">4.2.</span> <span class="nav-text">Second Normal Form(2NF)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Boyce-codd-Normal-Form-BCNF"><span class="nav-number">4.3.</span> <span class="nav-text">Boyce-codd Normal Form(BCNF)</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#BCNF-decomposition-algorithem-Given-a-relation-R-and-a-FD-set-F"><span class="nav-number">4.3.1.</span> <span class="nav-text">BCNF decomposition algorithem(Given a relation R and a FD set F):</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Problem-with-BCNF"><span class="nav-number">4.3.2.</span> <span class="nav-text">Problem with BCNF</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Third-Normal-Form-3NF"><span class="nav-number">4.4.</span> <span class="nav-text">Third Normal Form(3NF)</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#3NF-decomposition-algorithem-Given-a-relation-R-and-a-FD-set-F"><span class="nav-number">4.4.1.</span> <span class="nav-text">3NF decomposition algorithem(Given a relation R and a FD set F):</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#3NF-and-BCNF"><span class="nav-number">4.4.2.</span> <span class="nav-text">3NF and BCNF</span></a></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Anna</span>
</div>


<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	





  





  

  
      <!-- UY BEGIN -->
      <script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid="></script>
      <!-- UY END --><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"skipTags":["script","noscript","style","textarea","pre","code"],"processEscapes":true},"TeX":{"equationNumbers":{"autoNumber":"AMS"}}});
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->
  




  
  

  
  


  

  

  


</body>
</html>
